package homework0306;

import java.io.File;

public class DeleteFileDirDemo {
    public static void main(String[] args) {
        File file=new File("./text0.txt");
        if (file.exists()){
            file.delete();//删除file所代表的文件或者目录
            System.out.println("删除成功");
        }else {
            System.out.println("该目录/文件不存在");
        }
    }
}
